package main

import (
	"fmt"
	"github.com/garyburd/redigo/redis"
)


func main()  {
	conn,err := redis.Dial("tcp","192.168.1.201:6379")
	if err != nil {
		fmt.Println("connect redis error :",err)
		return
	}
	defer conn.Close()
	//_, err = conn.Do("HSET", "student","name", "wd","age",22)
	//_, err = conn.Do("HSET","askmeatadmin1" ,"alarm","true","cancel","false")
	//if err != nil {
	//	fmt.Println("redis mset error:", err)
	//}

	//isExist, err := conn.Do("hexists", "student", "age")
	//if err != nil {
	//	fmt.Println("hexist failed", err.Error())
	//} else {
	//	fmt.Println("exist or not:", isExist)
	//}


	_, err = conn.Do("HDEL", "askmeatadmin1", "cancel")
	if err != nil {
		fmt.Println("hdel failed", err.Error())
	}





	//res, err := redis.String(conn.Do("HGET", "askmeatadmin1","alarm"))
	//if err != nil {
	//	fmt.Println("redis HGET error:", err)
	//} else {
	//	fmt.Println(res)
	//	//res_type := reflect.TypeOf(res)
	//	//fmt.Printf("res type : %s \n", res_type)
	//	//fmt.Printf("res  : %d \n", res)
	//}
}//res type : int64
//res  : 22

